import 'package:flutter/material.dart';

/// <summary>
/// todo: APP主题配置
/// author：zwb
/// dateTime：2021/7/5 15:38
/// filePath：lib/config/theme.dart
/// desc:
/// <summary>
///
class AppTheme {
  /// todo：主题颜色
  static Color themeColor = Color(0xffFF6C6C);

  /// todo：输入框边框
  static var border = OutlineInputBorder(
    borderSide: BorderSide(color: Colors.transparent),
    gapPadding: 0,
  );

  /// todo：App主题
  static theme() {
    return ThemeData(
        primaryColor: themeColor,
        visualDensity: VisualDensity.adaptivePlatformDensity,
        iconTheme: _iconTheme(),
        appBarTheme: _appBarTheme(),
        inputDecorationTheme: _inputDecorationTheme(),
        buttonColor: themeColor,
        hoverColor: themeColor,
        fontFamily: 'Gen',
        textSelectionTheme: TextSelectionThemeData(
          cursorColor: themeColor,
        )
    );
  }

  /// todo：Icon主题
  static _iconTheme() => IconThemeData(color: themeColor, size: 24);

  /// todo：AppBar主题
  static _appBarTheme() => AppBarTheme(elevation: 0, brightness: Brightness.light);

  /// todo：输入框主题
  static _inputDecorationTheme() => InputDecorationTheme(
        contentPadding: EdgeInsets.fromLTRB(15, 0, 15, 0),
        border: border,
        disabledBorder: border,
        errorBorder: border,
        enabledBorder: border,
        focusedBorder: border,
        focusedErrorBorder: border,
      );
}
